#!/usr/bin/env python

import redis
import time,json

code = '000001-20'
r = redis.Redis(host='127.0.0.1', port=6379, db=0)
while True:
    d = json.loads(r.get(code))
    t = time.localtime(d['updTime'] / 1000)
    ts = time.strftime("%H:%M:%S",t)
    print code,ts, d['currentPrice']
    time.sleep(1)
